AsSequential(TSource) Method

Task Parallel System.Threading

Converts a ParallelQuery<(Of <(TSource>)>) into an IEnumerable<(Of <(T>)>) to force sequential evaluation of the query.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function AsSequential(Of TSource) ( _
	source As ParallelQuery(Of TSource) _
) As IEnumerable(Of TSource)
C#
public static IEnumerable<TSource> AsSequential<TSource>(
	ParallelQuery<TSource> source
)

Parameters

source
Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
A ParallelQuery<(Of <(TSource>)>) to convert to an IEnumerable<(Of <(T>)>).

Type Parameters

TSource
The type of elements of source.

Return Value

The source as an IEnumerable<(Of <(T>)>) to bind to sequential extension methods.

Exceptions

ExceptionCondition
System..::.ArgumentNullException source is a null reference (Nothing in Visual Basic).

See Also